package com.heima.ssm.controller;

import com.heima.ssm.domain.Product;
import com.heima.ssm.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private IProductService iProductService;
    @RequestMapping("/findAll")
//    @ResponseBody
    public String fndAll() throws Exception {
        List<Product> productList = iProductService.findAll();
        System.out.println(productList.size());
        return "";
    }
}
